#!/usr/bin/env python
# -*- coding: utf-8 -*-

# subscribe mymessage

import rospy
from geometry_msgs.msg import Twist
from std_msgs.msg import String


def InfoCallback(msg):
    rospy.loginfo("%s", msg.data)

def subscriber():
	# ROS节点初始化
    rospy.init_node('subscriber', anonymous=True)
    rospy.loginfo("%s", "fine")
	# 创建一个Subscriber，订阅名为/info的topic，注册回调函数InfoCallback
    rospy.Subscriber("xfwakeup", String, InfoCallback)

	# 循环等待回调函数
    rospy.spin()
	

if __name__ == '__main__':
    subscriber()


